- uses: actions/checkout@v2
- name: Cache Dependencies
uses: Swatinem/rust-cache@ce325b60658c1b38465c06cc965b79baf32c1e72
+ - name: Install just
+ run: dnf install -y just
- name: cargo fmt (check)
- run: |
- cargo fmt -p ostree -- --check -l
- for d in tests/inst tests/bootc-integration tests/xtask; do
- cargo fmt --manifest-path $d/Cargo.toml -- --check -l
- done
+ run: just cargo-fmt-check
- name: Build
run: cargo build --verbose --features=${{ env['CARGO_PROJECT_FEATURES'] }}
- name: Run tests
run: cargo test --verbose --features=${{ env['CARGO_PROJECT_FEATURES'] }}
- name: cargo clippy
- run: |
- CLIPPY_CONFIG="-A clippy::all -D clippy::correctness -D clippy::suspicious -Dunused_imports -Ddead_code"
- cargo clippy -p ostree --features=${{ env['CARGO_PROJECT_FEATURES'] }} -- $CLIPPY_CONFIG
- for d in tests/inst tests/bootc-integration tests/xtask; do
- cargo clippy --manifest-path $d/Cargo.toml -- $CLIPPY_CONFIG
- done
+ run: just cargo-clippy
- name: cargo doc
run: env RUSTDOCFLAGS='-D warnings' cargo doc --lib -p ostree --features=${{ env['CARGO_PROJECT_FEATURES'] }}
build-no-features:
v2023_1 = ["v2022_7", "ffi/v2023_1"]
v2023_8 = ["v2023_1", "ffi/v2023_8"]
v2023_11 = ["v2023_8", "ffi/v2023_11"]
-v2025_1 = ["v2023_11", "ffi/v2025_1"]
+v2024_7 = ["v2023_11", "ffi/v2024_7"]
+v2025_1 = ["v2024_7", "ffi/v2025_1"]
v2025_2 = ["v2025_1", "ffi/v2025_2"]
v2025_3 = ["v2025_2", "ffi/v2025_3"]
{{sourcefiles}} | xargs clang-format -i --Werror --dry-run
clippy_config := "-A clippy::all -D clippy::correctness -D clippy::suspicious -Dunused_imports -Ddead_code"
+cargo_project_features := env('CARGO_PROJECT_FEATURES', 'v2022_6')
# Run all Rust lint and format checks (mirrors CI)
validate:
# Run cargo clippy across all crates
cargo-clippy:
- cargo clippy -p ostree --features=v2022_6 -- {{clippy_config}}
+ cargo clippy -p ostree --features={{cargo_project_features}} -- {{clippy_config}}
for d in tests/inst tests/bootc-integration tests/xtask; do cargo clippy --manifest-path $d/Cargo.toml -- {{clippy_config}}; done
/// An open transaction in the repository.
///
-/// This will automatically invoke [`ostree::Repo::abort_transaction`] when the value is dropped.
+/// This will automatically invoke [`Repo::abort_transaction`] when the value is dropped.
pub struct TransactionGuard<'a> {
/// Reference to the repository for this transaction.
repo: Option<&'a Repo>,
crate::Repo::open_at(dir.as_raw_fd(), path, gio::Cancellable::NONE)
}
- /// A version of [`create_at`] which resolves the path relative to the provided directory file descriptor, and also returns the opened repo.
+ /// A version of [`Repo::create_at`] which resolves the path relative to the provided directory file descriptor, and also returns the opened repo.
#[cfg(any(feature = "v2017_10", feature = "dox"))]
pub fn create_at_dir(
dir: BorrowedFd<'_>,
Repo::open_at_dir(dir, path)
}
- /// A wrapper for [`prepare_transaction`] which ensures the transaction will be aborted when the guard goes out of scope.
+ /// A wrapper for [`Repo::prepare_transaction`] which ensures the transaction will be aborted when the guard goes out of scope.
pub fn auto_transaction<P: IsA<gio::Cancellable>>(
&self,
cancellable: Option<&P>,
/// Query metadata for a content object.
///
- /// This is similar to [`load_file`], but is more efficient if reading the file content is not needed.
+ /// This is similar to [`Repo::load_file`], but is more efficient if reading the file content is not needed.
pub fn query_file<P: IsA<gio::Cancellable>>(
&self,
checksum: &str,